Replication files for “The Drug Crisis and Voting Behavior” , Thiago M.Q. Moreira, Spencer Goidel, and Brenna Armstrong. Perspectives on Politics

The files in this folder permit replication of the analyses reported by the author. The codes replicate all figures and tables.

In order to replicate the main county-level analyses (Figures 3A and 3B), use “Model_Data.RData” and run the codes:
1_Figure3B_80Shock.R 
2_Figure3B_40Shock.R
3_Figure3B_20Shock.R
4_Figure3B_60Shock.R
5_Figure3B_100Shock.R
6_Figure3B_120Shock.R
7_Figure3B_SimPlots.R
8_Figure3A_TableA3.R 

In order to replicate the main individual-level analyses (Figures 4 and 4), use “IndLevel_Data.RData” and run the codes:
9_Figure4_TableA4.R
10_Figure5_TableA5.R

The data set “OtherQuestions.RData” and the code “11_Figure6_TableA6.R” plot Figure 6.

"dcinbox_emails_fentanyl.csv" and "dcinbox_emails_overdose.csv" are used to create Figure 1 with the code "12_Figure1.R."

The shape file "cb_2018_us_county_500k.shp" and the code "13_Figure2.R" plot the maps in Figure 2.

All the other codes replicate results in the online supplementary material, including:
- Figure A1
- Figure A2
- Figure A3
- Figure A5
- Table A6
- Table A7
- Table A8
- Table A9
- Table A10
- Table A11
